/*
 * Created on 2005/05/25
 * Author aki@www.xucker.jpn.org
 * License Apache2.0 or Common Public License
 */
package jp.sourceforge.akjrcp.ui.draw2d;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.PaletteData;
import org.eclipse.swt.graphics.RGB;

/**
 * 
 *
 */
public class AlphaUtils {
/*
 * don't forget dispose.
 */
    public static Image createColorAlphaImageData(Color color,int alpha){
    PaletteData palette=new PaletteData(new RGB[]{color.getRGB()});
    ImageData imageData = new ImageData(1,1,8,palette);
    imageData.alpha=alpha;
    imageData.setPixel(0,0,0);
    return new Image(null,imageData); 
}

}
